/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package beans;

import be.Dimensionpapel;
import be.Gramaje;
import be.Tipopapeldimension;
import be.Tipopapelgramaje;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;

/**
 *
 * @author yzavaleta
 */
@Named("managedBeanAdministracion")
@SessionScoped

public class ManagedBeanAdministracion implements Serializable {
    
    public ManagedBeanAdministracion() {
    }
    
        
    public void cargarComboTipoPapel(ManagedBeanTipoPapel beanTipoPapel, ManagedBeanGramaje beanGramaje, ManagedBeanDimensionPapel beanDimensiones) {
        List<Dimensionpapel> listaDimensionpapel = new LinkedList<>();
        List<Gramaje> listaGramaje = new LinkedList<>();
        
        
        for (Tipopapeldimension t : beanTipoPapel.getObjeto().getTipopapeldimensionList()) {
            if (t.getEstadoExistencia() == 1) {
                listaDimensionpapel.add(t.getDimensionpapel());
            }
        }
        
        
        for (Tipopapelgramaje t : beanTipoPapel.getObjeto().getTipopapelgramajeList()) {
            if (t.getEstadoExistencia() == 1) {
                listaGramaje.add(t.getGramaje());
            }
        }
        
        beanGramaje.llenar_myItemsDesdeCombo(listaGramaje);
      //  beanDimensiones.llenar_myItemsDesdeCombo(listaDimensionpapel);
    }
    
}
